mainpump = eventsystem.new()

function event(who,when,where,what,why) --Global entry to the event system for easy use
  --Who: who caused the event
  --When: when did the event occur, typically now
  --Where: in what subsystem
  --What: event its self (ie. hp = 5)
  --Why: human readable notes, for debuggins and such
  e = {}
  e.who = who or system
  e.when = when or now
  e.where = where or here
  e.what = what or ""
  e.why = why or ""  
  mainpump:post(e)
end

function geteventsnapshot()
  local s = mainpump:getsnapshot()
  mainpump:clear()
  return s
end

function peekevents()
  local s = mainpump:getsnapshot()
  print(eventsystem.serialize(s))
end
